package cn.lili.modules.order.order.mapper;

import cn.lili.modules.order.order.entity.dos.RankingActivityConfig;
import cn.lili.modules.order.order.entity.dos.RankingScoreDetails;
import cn.lili.modules.order.order.entity.dto.RankingScoreDetailsDTO;
import cn.lili.modules.order.order.entity.dto.TopUserDTO;
import cn.lili.modules.order.order.entity.vo.RankingScoreDetailsVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 积分记录表 Mapper 接口
 * </p>
 *
 * @author zhushiqing
 * @since 2023-12-21
 */
public interface RankingScoreDetailsMapper extends BaseMapper<RankingScoreDetails> {

    List<TopUserDTO> topUser(@Param("currentActivity") RankingActivityConfig currentActivity, @Param("sc") Double sc, @Param("status") Integer status);


    List<TopUserDTO> topUserLimit(@Param("currentActivity") RankingActivityConfig currentActivity, @Param("sc") Double sc, @Param("status") Integer status, @Param("limit1") Integer limit1, @Param("limit2") Integer limit2);


    /**
     * 获取排名积分
     * @param page
     * @param dto
     * @return
     */
    Page<RankingScoreDetailsVO> getRankingScoreDetail(Page<RankingScoreDetails> page, RankingScoreDetailsDTO dto);

    /**
     * 根据userid查询 结算 情况
     * @param dto
     * @return
     */
    List<RankingScoreDetailsVO> selectSettledScoreByUserIds(RankingScoreDetailsDTO dto);

    BigDecimal currentScore(@Param("currentActivity") RankingActivityConfig currentActivity,@Param("currentId") String currentId);
}
